#ifndef prs_FrmPanel_H
#define prs_FrmPanel_H

#include "prs_FrmFunc.h"
#include "prs_FrmControl.h"
#include "prs_FrmRules.h"
#include "prs_FrmGeom.h"
#include "prs_FrmPanelStyle.h"
#include "frm_control_TPanel.h"

namespace prs {

///////////////////////////////////////////////////////////////////////////////

struct TNodeFrmPanel : public TNodeFrmControl
{
  DECLARE_ClientNode()
  //
  typedef TNodeFrmPanelStyle   TStyle;
  typedef frm::control::TPanel TControl;
  //
  TAttrNodeType<nodeType_Panel> NodeType;
  TAttrPointerNoCopy<attrName_Control,frm::control::TPanel*> Control;
  //
  TNodeFrmPanel() : NodeType(this),Control(this) {}
 ~TNodeFrmPanel() { delete Control.GetValue();}
  
  frm::control::TPanel *BuildControl(
    frm::control::TPanel *ParentControl
  );

private:
  svl_Except();
};
                   
///////////////////////////////////////////////////////////////////////////////

struct TRuleFrmPanel : public snt::TRule
{
  TRuleFrmPanel(
    snt::text::TContext &Context,
    svl::TVariant &VParentNode,
    TRuleFrmChildrenBase &RChildren,
    TRuleSetNodeIdOptionally &RSetNodeIdOptionally,
    TRuleFrmGeom &RFrmGeom,
    TRuleSetStyle &RStyle
  );

private:  
  TNodeFrmPanel *GetNode() { return dynamic_cast<TNodeFrmPanel*>(vParentNode.Pointer());}
  //
  void FSetGeometry(snt::TParams &Params) { rGeometry.SetGeom( &GetNode()->Geometry.Value );}
  //
  svl::TVariant &vParentNode;
  TRuleFrmGeom &rGeometry;
  snt::TRule  RAttr,RAttr1;
  snt::TAlter AAttr1;
  svl_Except;
};

///////////////////////////////////////////////////////////////////////////////
}

#endif
